import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
	{
		path: '/',
		redirect: '/home',
		component: () => import('@/views/layouts/index'),
		children: [
			{
				path: '/home',
				component: () => import('@/views/home/index')
			},
			{
				path: '/img-upload',
				component: () => import('@/views/upload/img-upload/index')
			},
			{
				path: '/file-upload',
				component: () => import('@/views/upload/file-upload/index')
			},
			{
				path: '/multiple-file-upload',
				component: () => import('@/views/upload/multiple-file-upload/index')
			},
			{
				path: '/big-file-upload',
				component: () => import('@/views/upload/big-file-upload/index')
			},
			{
				path: '/big-file-already-upload',
				component: () => import('@/views/upload/big-file-already-upload/index')
			},
			{
				path: '/multiple-file-upload',
				component: () => import('@/views/upload/img-upload/index')
			},
			{
				path: '/file-upload-optimize',
				component: () => import('@/views/upload/file-upload-optimize/index')
			}
		]
	},
	{
		path: '/404',
		meta: {
			title: '找不到页面',
			noAuth: true
		},
		component: () => import('@/views/not-found/index')
	},
	{ path: '/:pathMatch(.*)*', redirect: '/404' }
]
const router = createRouter({
	history: createWebHashHistory(),
	routes
})

export default router
